# eric7.EricWidgets.EricZoomWidget

Module implementing a zoom widget for the status bar.

### Global Attributes

None

### Classes

EricZoomWidget | Class implementing a zoom widget for the status bar.

### Functions

None

## EricZoomWidget

Class implementing a zoom widget for the status bar.

### Signals

valueChanged(value)
  emitted to indicate the new zoom value (int)

### Derived from

QWidget, Ui_EricZoomWidget

### Class Attributes

None

### Class Methods

None

### Methods

EricZoomWidget | Constructor
__indexForValue | Private method to get the nearest index for a given value.
__setValueLabelWidth | Private slot to determine the width of the zoom value label.
__zoomIn | Private slot to zoom in one step.
__zoomOut | Private slot to zoom out one step.
__zoomReset | Private slot to reset the value.
_sliderValueChanged | Protected slot to handle changes of the slider value.
default | Public method to get the default zoom value.
isMapped | Public method to check for a mapped zoom widget.
isPercent | Public method to get the percent mode.
mapping | Public method to get the current mapping.
maximum | Public method to get the maximum value.
minimum | Public method to get the minimum value.
on_slider_sliderMoved | Private slot to handle changes of the zoom value.
pageStep | Public method to get the page step value.
setDefault | Public method to set the default zoom value.
setMapping | Public method to set a zoom level mapping.
setMaximum | Public method to set the maximum value.
setMinimum | Public method to set the minimum value.
setPageStep | Public method to set the page step value.
setPercent | Public method to set the percent mode of the widget.
setSingleStep | Public method to set the single step value.
setValue | Public slot to set the value.
singleStep | Public method to get the single step value.
value | Public method to get the current value.

### Static Methods

None

#### EricZoomWidget (Constructor)

EricZoomWidget(outPix, inPix, resetPix, parent=None)

Constructor

outPix (QPixmap)
  pixmap for the zoom out button
inPix (QPixmap)
  pixmap for the zoom in button
resetPix (QPixmap)
  pixmap for the zoom reset button
parent (QWidget)
  reference to the parent widget

#### EricZoomWidget.__indexForValue

__indexForValue(value)

Private method to get the nearest index for a given value.

value (int)
  value to get the index for

Return:
  index into the mapping list or the unchanged value, if mapping is not set

Return Type:
  int

#### EricZoomWidget.__setValueLabelWidth

__setValueLabelWidth()

Private slot to determine the width of the zoom value label.

#### EricZoomWidget.__zoomIn

__zoomIn()

Private slot to zoom in one step.

#### EricZoomWidget.__zoomOut

__zoomOut()

Private slot to zoom out one step.

#### EricZoomWidget.__zoomReset

__zoomReset()

Private slot to reset the value.

#### EricZoomWidget._sliderValueChanged

_sliderValueChanged(value)

Protected slot to handle changes of the slider value.

value (int)
  slider value

#### EricZoomWidget.default

default()

Public method to get the default zoom value.

Return:
  default zoom value

Return Type:
  int

#### EricZoomWidget.isMapped

isMapped()

Public method to check for a mapped zoom widget.

Return:
  flag indicating a mapped zoom widget

Return Type:
  bool

#### EricZoomWidget.isPercent

isPercent()

Public method to get the percent mode.

Return:
  flag indicating percent mode

Return Type:
  bool

#### EricZoomWidget.mapping

mapping()

Public method to get the current mapping.

Return:
  tuple of the mapping and the default index

Return Type:
  tuple of (list of integer, integer)

#### EricZoomWidget.maximum

maximum()

Public method to get the maximum value.

Return:
  maximum value

Return Type:
  int

#### EricZoomWidget.minimum

minimum()

Public method to get the minimum value.

Return:
  minimum value

Return Type:
  int

#### EricZoomWidget.on_slider_sliderMoved

on_slider_sliderMoved(value)

Private slot to handle changes of the zoom value.

value (int)
  value of the slider

#### EricZoomWidget.pageStep

pageStep()

Public method to get the page step value.

Return:
  page step value

Return Type:
  int

#### EricZoomWidget.setDefault

setDefault(value)

Public method to set the default zoom value.

value (int)
  default zoom value

#### EricZoomWidget.setMapping

setMapping(mapping, default, percent=True)

Public method to set a zoom level mapping.

When zoom level mapping is activated, the slider covers values from 0 to the max. index of the mapping list. The default value is the value of the default zoom level. If percent is given, the zoom level is shown as a percent value.

mapping (list of int)
  list of mapping values
default (int)
  index of the default value
percent (bool)
  flag indicating to show zoom value in percent

#### EricZoomWidget.setMaximum

setMaximum(maximum)

Public method to set the maximum value.

maximum (int)
  new maximum value

#### EricZoomWidget.setMinimum

setMinimum(minimum)

Public method to set the minimum value.

minimum (int)
  new minimum value

#### EricZoomWidget.setPageStep

setPageStep(value)

Public method to set the page step value.

value (int)
  page step value

#### EricZoomWidget.setPercent

setPercent(on)

Public method to set the percent mode of the widget.

on (bool)
  flag indicating percent mode

#### EricZoomWidget.setSingleStep

setSingleStep(value)

Public method to set the single step value.

value (int)
  value for the single step

#### EricZoomWidget.setValue

setValue(value)

Public slot to set the value.

value (int)
  new zoom value

#### EricZoomWidget.singleStep

singleStep()

Public method to get the single step value.

Return:
  single step value

Return Type:
  int

#### EricZoomWidget.value

value()

Public method to get the current value.

Return:
  current zoom value

Return Type:
  int

Up